package com.samehope.ar.mapper;

import com.samehope.ar.entity.ProjectTeam;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.samehope.ar.vo.FormSelectVO;
import com.samehope.ar.vo.ProjectTeamDataVO;
import com.samehope.ar.vo.TreeDataVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 项目团队 Mapper 接口
 * </p>
 *
 * @author Zhang Luo
 * @since 2019-12-23
 */
public interface ProjectTeamMapper extends BaseMapper<ProjectTeam> {

    /**
     * 根据企业和项目查找项目团队
     * @param companyId
     * @param projectId
     * @return
     */
    List<ProjectTeamDataVO> findByProject(@Param("companyId") Long companyId,
                                                    @Param("projectId") Long projectId);


    ProjectTeam findByProjectTeamName(@Param("companyId") Long companyId,
                                                    @Param("projectId") Long projectId,
                                                  @Param("teamName") String teamName,
                                                  @Param("teamId") Long teamId);

    /**
     * 获取团队树结构
     * @param projectId
     * @return
     */
    List<TreeDataVO> getTreeByProject(Long projectId);

    /**
     * 获取团队下拉框数据
     * @param projectId
     * @return
     */
    List<FormSelectVO> listForSelectByProject(Long projectId);
}
